﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Masterpage/MasterPage.Master" CodeBehind="ProductDetails.aspx.cs" Inherits="MobileUI.ProductDetails" %>



<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style>
        .tblProduct:hover
        {
            border: 1px gray solid;
        }
        .tblProduct
        {
            border: 1px #fff solid;
        }
        .link
        {
        }
        .link:hover
        {
            color: black;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
    <a href="#">
        <img src="../images/3b3e2d44-807e-4979-a23e-9affe4d1594c.jpg" width="590" /></a>
    <div style="padding: 20px">
        <div style="font-weight: bold">
            PRODUCT DETAILS</div>
        <hr />
       
    </div>
    <asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1" RepeatColumns="1"
        CellPadding="0" CellSpacing="5" Width="560px">
        <ItemTemplate>
            <table class="" border="0" cellpadding="0" cellspacing="0" width="560"
                border="1">
                <tr>
                    <td width="350" valign="top" align="center">
                        <br />
                        <asp:HyperLink ID="HyperLink2" runat="server" CssClass="link" NavigateUrl='<%# "ProductDetails.aspx?Id="+Eval("Id") %>'>
                            <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("Image", "~/images/{0}") %>'
                                Width="300px" /></asp:HyperLink><br />
                        <br />
                       
                    </td>
                    
                    <td style="vertical-align: top;"><br /> <asp:HyperLink ID="HyperLink1" Font-Bold="true" runat="server" CssClass="link" NavigateUrl='<%# "ProductDetails.aspx?Id="+Eval("Id") %>'
                            Text='<%# "Product name: " + Eval("Name") %>'></asp:HyperLink>
                        <br /><br />
                        <asp:HyperLink ID="HyperLink3" Font-Bold="true" runat="server" CssClass="link" NavigateUrl='<%# "Product.aspx?Id="+Eval("Expr2") %>'
                            Text='<%# "Provider name: " + Eval("Expr1") %>'></asp:HyperLink>
                        <br /><br />
                         <asp:Label ID="HyperLink5"  runat="server" 
                            Text='<%# "Description: " + Eval("Description") %>'></asp:Label>
                        <br /><br />
                        <asp:Label ID="Label1" Font-Bold="true" CssClass="price" runat="server" Text='<%# "Price: "+Eval("Price")+" USD" %>'></asp:Label>
                        <br /><br />
                        <asp:HyperLink ID="HyperLink4" runat="server" NavigateUrl='<%# "ShoppingCart.aspx?Id="+Eval("Id") %>'
                            CssClass="link">Add to Cart</asp:HyperLink><br />
                        <br /></td>
                </tr>
            </table>
        </ItemTemplate>
    </asp:DataList>
    <asp:SqlDataSource ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:MobileConnectionString %>"
        
        SelectCommand="SELECT Product.Id, Product.ProviderId, Product.Name, Product.Description, Product.Quantity, Product.Price, Product.Image, Provider.Name AS Expr1, Provider.Id AS Expr2 FROM Product INNER JOIN Provider ON Product.ProviderId = Provider.Id WHERE (Product.Id = @Id)" 
        runat="server">
        <SelectParameters>
            <asp:QueryStringParameter DefaultValue="1" Name="Id" QueryStringField="Id" />
        </SelectParameters>
    </asp:SqlDataSource>
        <div style="padding: 20px">
        <div style="font-weight: bold">
            OTHER PRODUCT</div>
        <hr />
        
    </div>
    <asp:DataList ID="DataList2" runat="server" DataSourceID="SqlDataSource2" RepeatColumns="4"
        CellPadding="0" CellSpacing="5" Width="560px">
        <ItemTemplate>
            <table class="tblProduct" border="0" cellpadding="0" cellspacing="0" width="140"
                border="1">
                <tr>
                    <td width="90" valign="top" align="center">
                        <br />
                        <asp:HyperLink ID="HyperLink2" runat="server" CssClass="link" NavigateUrl='<%# "ProductDetails.aspx?Id="+Eval("Id") %>'>
                            <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("Image", "~/images/{0}") %>'
                                Width="100px" /></asp:HyperLink><br />
                        <br />
                        <asp:HyperLink ID="HyperLink1" Font-Bold="true" runat="server" CssClass="link" NavigateUrl='<%# "ProductDetails.aspx?Id="+Eval("Id") %>'
                            Text='<%# Eval("Name") %>'></asp:HyperLink>
                        <br />
                        <asp:Label ID="Label1" CssClass="price" runat="server" Text='<%# "Price: "+Eval("Price")+" USD" %>'></asp:Label>
                        <br />
                        <asp:HyperLink ID="HyperLink4" runat="server" NavigateUrl='<%# "ShoppingCart.aspx?Id="+Eval("Id") %>'
                            CssClass="link">Add to Cart</asp:HyperLink><br />
                        <br />
                    </td>
                </tr>
            </table>
        </ItemTemplate>
    </asp:DataList>
    <asp:SqlDataSource ID="SqlDataSource2" ConnectionString="<%$ ConnectionStrings:MobileConnectionString %>"
        SelectCommand="SELECT TOP (8) * FROM Product" runat="server"></asp:SqlDataSource>
</asp:Content>

